<?php


namespace support\middleware;

use Webman\MiddlewareInterface;
use Webman\Http\Response;
use Webman\Http\Request;

class BaseControl implements MiddlewareInterface
{
    public function process(Request $request, callable $next): Response
    {
        $appid = $request->header('appid');
        if(!isset($appid)){
            return error('401','appid is null');
        }
        else{
            $request->app_id = $appid;
            $response = $next($request);
        }
        return $response;
    }
}